import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'

import home from './modules/home'
Vue.use(Vuex)

export default new Vuex.Store({
  plugins: [
    createPersistedState({
      storage: window.localStorage,
      reducer: (state) => {
        return {
          globalData: state.globalData,
          task: state.task,
        }
      },
    }),
  ],
  state: {
    globalData: {},
  },
  mutations: {},
  actions: {},
  modules: { home },
})
